Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jun 21, 2023

This PR contains the following updates:

Package Change Age Confidence
socket.io (source) ^1.4.8^2.5.1 age confidence

GitHub Vulnerability Alerts

CVE-2020-28481

The package socket.io before 2.4.0 are vulnerable to Insecure Defaults due to CORS Misconfiguration. All domains are whitelisted by default.

CVE-2024-38355

Impact

A specially crafted Socket.IO packet can trigger an uncaught exception on the Socket.IO server, thus killing the Node.js process.

node:events:502
    throw err; // Unhandled 'error' event
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. (undefined)
    at new NodeError (node:internal/errors:405:5)
    at Socket.emit (node:events:500:17)
    at /myapp/node_modules/socket.io/lib/socket.js:531:14
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  code: 'ERR_UNHANDLED_ERROR',
  context: undefined
}

Affected versions

Version range Needs minor update?
4.6.2...latest Nothing to do
3.0.0...4.6.1 Please upgrade to [email protected] (at least)
2.3.0...2.5.0 Please upgrade to [email protected]

Patches

This issue is fixed by socketio/socket.io@15af22f, included in [email protected] (released in May 2023).

The fix was backported in the 2.x branch today: socketio/socket.io@d30630b

Workarounds

As a workaround for the affected versions of the socket.io package, you can attach a listener for the "error" event:

io.on("connection", (socket) => {
  socket.on("error", () => {
    // ...
  });
});

For more information

If you have any questions or comments about this advisory:

  • Open a discussion here

Thanks a lot to Paul Taylor for the responsible disclosure.

References


Release Notes

socketio/socket.io (socket.io)

v2.5.1

Compare Source

Bug Fixes
  • add a noop handler for the error event (d30630b)
Links:

v2.5.0

Compare Source

⚠️ WARNING ⚠️

The default value of the maxHttpBufferSize option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service.

Security advisory: GHSA-j4f2-536g-r55m

Bug Fixes
  • fix race condition in dynamic namespaces (05e1278)
  • ignore packet received after disconnection (22d4bdf)
  • only set 'connected' to true after middleware execution (226cc16)
  • prevent the socket from joining a room after disconnection (f223178)
Links:

v2.4.1

Compare Source

This release reverts the breaking change introduced in 2.4.0 (f78a575).

If you are using Socket.IO v2, you should explicitly allow/disallow cross-origin requests:

  • without CORS (server and client are served from the same domain):
const io = require("socket.io")(httpServer, {
  allowRequest: (req, callback) => {
    callback(null, req.headers.origin === undefined); // cross-origin requests will not be allowed
  }
});
  • with CORS (server and client are served from distinct domains):
io.origins(["http://localhost:3000"]); // for local development
io.origins(["https://example.com"]);

In any case, please consider upgrading to Socket.IO v3, where this security issue is now fixed (CORS is disabled by default).

Reverts
  • fix(security): do not allow all origins by default (a169050)
Links:

v2.4.0

Compare Source

Related blog post: https://socket.io/blog/socket-io-2-4-0/

Features (from Engine.IO)
  • add support for all cookie options (19cc582)
  • disable perMessageDeflate by default (5ad2736)
Bug Fixes
  • security: do not allow all origins by default (f78a575)
  • properly overwrite the query sent in the handshake (d33a619)

⚠️ BREAKING CHANGE ⚠️

Previously, CORS was enabled by default, which meant that a Socket.IO server sent the necessary CORS headers (Access-Control-Allow-xxx) to any domain. This will not be the case anymore, and you now have to explicitly enable it.

Please note that you are not impacted if:

  • you are using Socket.IO v2 and the origins option to restrict the list of allowed domains
  • you are using Socket.IO v3 (disabled by default)

This commit also removes the support for '*' matchers and protocol-less URL:

io.origins('https://example.com:443'); => io.origins(['https://example.com']);
io.origins('localhost:3000');          => io.origins(['http://localhost:3000']);
io.origins('http://localhost:*');      => io.origins(['http://localhost:3000']);
io.origins('*:3000');                  => io.origins(['http://localhost:3000']);

To restore the previous behavior (please use with caution):

io.origins((_, callback) => {
  callback(null, true);
});

See also:

Thanks a lot to @​ni8walk3r for the security report.

Links:

v2.3.0

Compare Source

This release mainly contains a bump of the engine.io and ws packages, but no additional features.

Links:

v2.2.0

Compare Source

Features
  • add cache-control header when serving the client source (#​2907)
Bug fixes
  • throw an error when trying to access the clients of a dynamic namespace (#​3355)
Links

v2.1.1

Compare Source

Features

  • add local flag to the socket object (#​3219)
socket.local.to('room101').emit(/* */);

Bug fixes

(client) fire an error event on middleware failure for non-root namespace (socketio/socket.io-client#1202)

Links:

v2.1.0

Compare Source

Features

// by default, the object is recursively scanned to check whether it contains some binary data
// in the following example, the check is skipped in order to improve performance
socket.binary(false).emit('plain-object', object);

// it also works at the namespace level
io.binary(false).emit('plain-object', object);
  • add support for dynamic namespaces (#​3195)
io.of(/^\/dynamic-\d+$/).on('connect', (socket) => {
  // socket.nsp.name = '/dynamic-101'
});

// client-side
const client = require('socket.io-client')('/dynamic-101');

Bug fixes

  • properly emit 'connect' when using a custom namespace (#​3197)
  • include the protocol in the origins check (#​3198)

Important note ⚠️ from Engine.IO 3.2.0 release

There are two non-breaking changes that are somehow quite important:

  • ws was reverted as the default wsEngine (socketio/engine.io#550), as there was several blocking issues with uws. You can still use uws by running npm install uws --save in your project and using the wsEngine option:
var engine = require('engine.io');
var server = engine.listen(3000, {
  wsEngine: 'uws'
});
Links:

v2.0.4

Compare Source

Bug fixes

  • do not throw when receiving an unhandled error packet (#​3038)
  • reset rooms object before broadcasting from namespace (#​3039)
Links:

v2.0.3

Compare Source

Bug fixes

  • reset rooms object before broadcasting (#​2970)
  • fix middleware initialization (#​2969)
Links:

v2.0.2

Compare Source

Bug fixes

  • fix timing issues with middleware (#​2948)
Links:

v2.0.1

Compare Source

Bug fixes

- update path of client file (#​2934)

Links:

v2.0.0

Compare Source

This major release brings several performance improvements:

  • uws is now the default Websocket engine. It should bring significant improvement in performance (particularly in terms of memory consumption) (https://github.com/socketio/engine.io/releases/tag/2.0.0)

  • the Engine.IO and Socket.IO handshake packets were merged, reducing the number of roundtrips necessary to establish a connection. (#​2833)

  • it is now possible to provide a custom parser according to the needs of your application (#​2829). Please take a look at the example for more information.

Please note that this release is not backward-compatible, due to:

Please also note that if you are using a self-signed certificate, rejectUnauthorized now defaults to true (socketio/engine.io-client#558).

Finally, the API documentation is now in the repository (here), and the content of the website here. Do not hesitate if you see something wrong or missing!

The full list of changes:

Besides, we are proud to announce that Socket.IO is now a part of open collective: https://opencollective.com/socketio. More on that later.

v1.7.4

Compare Source

  • [chore] Bump engine.io to version 1.8.4

v1.7.3

Compare Source

  • [chore] Bump engine.io-client to version 1.8.3

v1.7.2

Compare Source

  • [chore] Bump engine.io to version 1.8.2 (#​2782)
  • [fix] Fixes socket.use error packet (#​2772)

v1.7.1

Compare Source

(following socket.io-client update)

v1.7.0

Compare Source

  • [docs] Comment connected socket availability for adapters (#​2081)
  • [docs] Fixed grammar issues in the README.md (#​2159)
  • [feature] serve sourcemap for socket.io-client (#​2482)
  • [feature] Add a local flag (#​2628)
  • [chore] Bump engine.io to version 1.8.1 (#​2765)
  • [chore] Update client location and serve minified file (#​2766)

v1.6.0

Compare Source

  • [fix] Make ETag header comply with standard. (#​2603)
  • [feature] Loading client script on demand. (#​2567)
  • [test] Fix leaking clientSocket (#​2721)
  • [feature] Add support for all event emitter methods (#​2601)
  • [chore] Update year to 2016 (#​2456)
  • [feature] Add support for socket middleware (#​2306)
  • [feature] add support for Server#close(callback) (#​2748)
  • [fix] Don't drop query variables on handshake (#​2745)
  • [example] Add disconnection/reconnection logs to the chat example (#​2675)
  • [perf] Minor code optimizations (#​2219)
  • [chore] Bump debug to version 2.3.3 (#​2754)
  • [chore] Bump engine.io to version 1.8.0 (#​2755)
  • [chore] Bump socket.io-adapter to version 0.5.0 (#​2756)

v1.5.1

Compare Source

  • [fix] Avoid swallowing exceptions thrown by user event handlers (#​2682)
  • [test] Use client function to unify client in test script (#​2731)
  • [docs] Add link to LICENSE (#​2221)
  • [docs] Fix JSDoc of optional parameters (#​2465)
  • [docs] Fix typo (#​2724)
  • [docs] Link readme npm package badge to npm registry page (#​2612)
  • [docs] Minor fixes (#​2526)
  • [chore] Bump socket.io-parser to 2.3.0 (#​2730)
  • [chore] Add Github issue and PR templates (#​2733)
  • [chore] Bump engine.io to 1.7.2 (#​2729)
  • [chore] Bump socket.io-parser to 2.3.1 (#​2734)

v1.5.0

Compare Source

  • [feature] stop append /# before id when no namespace (#​2509)
  • [feature] Add a 'disconnecting' event to access to socket.rooms upon disconnection (#​2332)
  • [fix] Fix query string management (#​2422)
  • [fix] add quote to exec paths, prevent error when spaces in path (#​2508)
  • [docs] Prevent mixup for new programmers (#​2599)
  • [example] Fix chat display in Firefox (#​2477)
  • [chore] Add gulp & babel in the build process (#​2471)
  • [chore] Bump engine.io to 1.7.0 (#​2707)
  • [chore] Remove unused zuul-ngrok dependency (#​2708)
  • [chore] Point towards current master of socket.io-client (#​2710)
  • [chore] Restrict files included in npm package (#​2709)
  • [chore] Link build badge to master branch (#​2549)

Configuration

📅 Schedule: Branch creation - "" in timezone Europe/Zurich, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 39c90d4 to d292954 Compare June 22, 2023 23:57
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jun 22, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from d292954 to a77f5f0 Compare June 30, 2023 02:28
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jun 30, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from a77f5f0 to e005747 Compare July 1, 2023 01:56
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 1, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from e005747 to e1a0d7a Compare July 7, 2023 23:58
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jul 7, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from e1a0d7a to 953412b Compare July 8, 2023 05:27
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 8, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 953412b to ef71150 Compare July 10, 2023 05:37
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jul 10, 2023
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 11, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch 2 times, most recently from 7d8d4b3 to 95a87f9 Compare July 18, 2023 02:47
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jul 18, 2023
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 20, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 95a87f9 to f875134 Compare July 20, 2023 02:44
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from f875134 to d6d6b5e Compare July 28, 2023 08:55
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jul 28, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from d6d6b5e to 26b3ce4 Compare July 29, 2023 02:26
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jul 29, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 26b3ce4 to 763c376 Compare August 5, 2023 05:46
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Aug 5, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 763c376 to 6fc3b50 Compare August 6, 2023 05:40
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Aug 6, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 6fc3b50 to 2fe945e Compare August 10, 2023 02:35
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Aug 10, 2023
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 3c75e2c to 58083a6 Compare September 2, 2025 06:54
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 58083a6 to 93934b6 Compare September 26, 2025 19:47
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 93934b6 to fac16b1 Compare September 27, 2025 06:46
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Sep 27, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from fac16b1 to 94601f8 Compare October 23, 2025 19:45
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Oct 23, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 94601f8 to 1f71b7f Compare October 25, 2025 23:58
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Oct 25, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 1f71b7f to 86f3b04 Compare November 16, 2025 08:01
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Nov 16, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 86f3b04 to 3a0eaf1 Compare November 20, 2025 11:36
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Nov 20, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 3a0eaf1 to 9e71b1b Compare December 4, 2025 20:11
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Dec 4, 2025
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Dec 5, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 9e71b1b to 83129d5 Compare December 5, 2025 12:03
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 83129d5 to 6505a88 Compare December 30, 2025 12:14
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Dec 30, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 6505a88 to adb5965 Compare December 31, 2025 04:07
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Dec 31, 2025
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from adb5965 to 5beab6c Compare January 1, 2026 20:09
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jan 1, 2026
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 5beab6c to 3e06de9 Compare January 2, 2026 15:46
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jan 2, 2026
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 3e06de9 to 1da04aa Compare January 9, 2026 07:07
@renovate renovate bot changed the title Update dependency socket.io to v2 [SECURITY] Update dependency socket.io to v4 [SECURITY] Jan 9, 2026
@renovate renovate bot force-pushed the renovate/npm-socket.io-vulnerability branch from 1da04aa to 9c0cd4a Compare January 10, 2026 07:54
@renovate renovate bot changed the title Update dependency socket.io to v4 [SECURITY] Update dependency socket.io to v2 [SECURITY] Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant